@use './mixins/mixins' as *;
@use 'element-plus/theme-chalk/el-tree.css';

@include b(tree-node) {
  flex: 1;
  overflow: hidden;

  @include e(main) {
    flex: 1;
    padding: 5px 2px;
    overflow: hidden;
  }

  @include when(editable) {
    @include e(more) {
      display: none;
    }
  }

  @include e(more) {
    margin-left: 10px;
    @apply text-slate-600;
    display: inline-flex;
    align-items: center;
    visibility: hidden;

    &.active {
      visibility: visible;
    }
  }
}

.el-tree-node {
  &.is-dir &__expand-icon,
  &__content:hover .ac-tree-node__more {
    visibility: visible;
  }

  &.is-doc &__expand-icon {
    visibility: hidden;
  }
}

@include b(doc-node) {
  display: flex;
  align-items: center;
  padding-left: 4px;

  @include e(icon) {
    width: 16px;
    height: 16px;
    margin-left: -5px;
    margin-right: 4px;
    line-height: 1.1;
  }

  @include e(label) {
    flex: 1;
    width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  @include e(input) {
    flex: 1;
    height: auto;
    line-height: 1.5;
    border-radius: var(--el-border-radius-base);
    padding: 2px 4px;
    box-shadow: 0 0 0 1px var(--primary-color) inset;
  }

  @include when(active) {
    @include e(label) {
      color: var(--primary-color);
    }
  }
}
